<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="./lib/vue-2.4.0.js"></script>
    <script src="./lib/vue-resource-1.3.4.js"></script>
</head>

<body>
    <div id="app">
        <h1>11111</h1>

        <com1></com1>
        <com2></com2>
        <com3></com3> 
        <com4></com4> 
        <com5></com5> 
        <com6>
               
        </com6> 
        <com7></com7> 
        <com8></com8> 
    </div>

    <template id="tpl4">
            <h1>no.4</h1>
    </template>

    <script type="x-template" id="tpl5">
            <h1>no.5</h1>
    </script>

     <template id="tpl7">
            <h1>no.7</h1>
    </template>


    <script>
     
      var  aa= Vue.extend({
           template:"<h1>no.1</h1>"
       })
       Vue.component("com1",aa)

       
       Vue.component("com2",Vue.extend({
           template:"<h1>no.2</h1>"
       }))

       Vue.component("com3",{
           template:"<h1>no.3</h1>"
       })

       Vue.component("com4",{
           template:"#tpl4"
       })

       Vue.component("com5",{
           template:"#tpl5"
       })

       Vue.component("com7",{
           template:"#tpl7"
       })


       var  com8={
           template:"<h1>这是第8个组件</h1>"
       }


        var vm = new Vue({
            el: "#app",
            data: {
                msg:"========="
            },
            methods: {

            },
            components:{
                "com6":{
                    template:"<h1>这是{{aa}}私有组件====== <son></son></h1>",
                    data(){
                        return  {
                            aa:123
                        }
                    },
                    methods:{},
                    components:{
                        "son":{
                            template:"<h1>这是son私有组件</h1>",
                        }
                    }
                },
                com8:com8
            }
        })
    </script>

</body>

</html>